#include "record_desktop.h"
#include <iostream>
record_desktop::record_desktop()
{
	_running = false;
	_paused = false;
	_inited = false;
	_device_name = "";
	//_data_type = RECORD_DESKTOP_DATA_TYPES::AT_DESKTOP_BGRA;
	//_pixel_fmt = AV_PIX_FMT_NONE;
}

record_desktop::~record_desktop()
{

}

void record_desktop::do_sleep(int64_t dur, int64_t pre, int64_t now)
{
	int64_t delay = now - pre;
	//std::cout << "delay:" << dur << ",pre:" << pre << ",now:" << now << std::endl;
	if (dur > delay) {
		dur =  dur - delay;
		std::this_thread::sleep_for(std::chrono::milliseconds(dur));
		//std::cout << "sleep:" << dur << std::endl;
	}

}
